next up previous contents index
Next: Units Up: Programsunits, blocks Previous: Programsunits, blocks

Programs

A pascal program consists of the program header, followed possibly by a 'uses' clause, and a block.


Programs

syntdiag4499

syntdiag4503

syntdiag4507

syntdiag4511

syntdiag4515

The program header is provided for backwards compatibility, nd is oignored by the compiler.

The uses clause serves to identify all units that are needed by the program. The system unit doesn't have to be in this list, since it is always loaded by the compiler.

The order in which the units appear is significant, it determines in which order they are initialized. Units are initialized in the same order as they appear in the uses clause. Identifiers are searched in the opposite order, i.e. when the compiler searches for an identifier, then it looks first in the last unit in the uses clause, then the last but one, and so on.

This is important in case two units declare different types with the same identifier.

When the compiler looks for unit files, it adds the extension .ppu (.ppw for WINDOWSNT) to the name of the unit. On LINUX, unit names are converted to all lowercase when looking for a unit.

If a unit name is longer than 8 characters, the compiler will first look for a unit name with this length, and then it will truncate the name to 8 characters and look for it again.


next up previous contents index
Next: Units Up: Programsunits, blocks Previous: Programsunits, blocks

Michael Van Canneyt
Fri Sep 25 09:15:40 MEST 1998